from django.db import models
class Students(models.Model):
    sname = models.CharField(max_length=20,verbose_name='学生名字')
    sage = models.IntegerField(verbose_name='年龄')
    ssex = models.CharField(max_length=10,choices=[('boy','男'),('girl','女')],verbose_name='性别')
    sheight = models.FloatField(verbose_name='身高')
    sweight = models.FloatField(verbose_name='体重')
    sdescription = models.CharField(max_length=50,verbose_name='介绍')
    isDelete = models.BooleanField(default=False,verbose_name='是否删除')
    screteTime = models.DateTimeField(auto_now_add=True,verbose_name='创建时间')
    supdateTime = models.DateTimeField(auto_now=True,verbose_name='更新时间')

    def __str__(self):
        return self.sname

    @classmethod
    def addStudents(cls,sname,sage,ssex,sheight,sweight,scontend):
        newStudent = cls(sname=sname,sage=sage,ssex=ssex,sheight=sheight,sweight=sweight,sdescription=sdescription)
        return newStudent




class Grades(models.Model):
    gname = models.CharField(max_length=20,verbose_name='学生名字')
    gteacher = models.CharField(max_length=20)
    ggirlnum = models.IntegerField()
    gboynum = models.IntegerField()
    isDelete = models.BooleanField()
    gcreateTime = models.DateTimeField()
    gupdateTime = models.DateTimeField()



    def __str__(self):
        return self.gname


    @classmethod
    def addStudents(cls,gname,gteacher,ggirlnum,gboynum,):
        newGr = cls(gname=gname,gteacher=gteacher,ggirlnum=ggirlnum,gboynum=gboynum)
        return newGr